import sys
import pickle
import re
import codecs
import string
import shutil
from win32com import client as wc
import docx
import os


path = 'C:\\Users\\zack\\Documents\\'
def batch():
    for filename in os.listdir(path + 'doc'):
        if filename.endswith('.doc'):
            doSaveAs(path + 'doc\\' + filename)



def doSaveAs(filename):
    print(filename)
    doc = word.Documents.Open(filename)
    new_filename = path + 'docx' + '\\' + filename.split('\\')[-1].split('.')[0] + '.docx'
    doc.SaveAs(new_filename, 12, False, "", True,"", False, False, False, False)
    doc.Close()
    print(new_filename)
    print()


word = wc.Dispatch('Word.Application')
batch()
word.Quit()
